package org.exhaust.barbecue;

import java.util.HashMap;
import java.util.Map;

public class ActionContext {

    private AbstractRequest request;

    private AbstractResponse response;

    private Map params = null;

    public void putParam(String name, Object value) {
        if (params == null) {
            params = new HashMap();
        }
        params.put(name, value);
    }

    public Object getValue(String name) {
        if (params == null) {
            return null;
        }
        return params.get(name);
    }

    public void clear() {
        if (this.params != null) {
            this.params.clear();
        }
    }

    public void setRequest(AbstractRequest request) {
        this.request = request;
    }

    public void setResponse(AbstractResponse response) {
        this.response = response;
    }
}
